#include <bits/stdc++.h>

using namespace std;
int f(int n){
    vector<int> v = {1, 1};
    int ans = 0;
    while(*v.rbegin() < n) v.push_back(v[v.size() - 1] + v[v.size() - 2]);
    reverse(v.begin(), v.end());
    for (int i : v) {
        if (i <= n) {
            n -= i;
            ans++;
        }
        if(!n) return ans;
    }
    return -1;
}
int main(){
    assert(f(7) == 2);
    assert(f(13) == 1);
    return 0;
}
